package com.example.order.dao.po;

import com.baomidou.mybatisplus.annotation.*;
import com.example.order.enums.PaymentStatus;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("`order`")
public class Order {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @TableField(value = "user_id")
    private Long userId;
    @TableField(value = "user_currency")
    private String userCurrency;
    private String address;
    private String email;
    @TableField(value = "created_at")
    private Long createdAt;
    @TableField(value = "payment_status")
    private PaymentStatus paymentStatus;
    private Long cost;
    @TableLogic
    private boolean deleted;
}

//CREATE TABLE `order_info` (
//    `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '订单ID',
//    `user_id` BIGINT NOT NULL COMMENT '用户ID',
//    `user_currency` VARCHAR(10) NOT NULL COMMENT '用户货币类型',
//    `address` VARCHAR(255) NOT NULL COMMENT '收货地址',
//    `email` VARCHAR(100) COMMENT '联系邮箱',
//    `created_at` BIGINT NOT NULL COMMENT '订单创建时间戳',
//    `payment_status` VARCHAR(20) NOT NULL COMMENT '支付状态',
//    `cost` BIGINT NOT NULL COMMENT '订单金额（单位：分）',
//    `deleted` TINYINT(1) DEFAULT 0 COMMENT '逻辑删除标志',
//    PRIMARY KEY (`id`),
//    INDEX `idx_user` (`user_id`)
//    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单信息表';
